package demo.jvm;


import tech.medivh.classpy.classfile.ClassFile;

import java.io.File;
import java.util.Arrays;

/**
 * @author : feixiang.li
 * @since : 2025-09-22 10:42
 */
public class HotSpot {

    private String mainClass;


    private BootstrapClassLoader bootstrapClassLoader;

    public HotSpot(String mainClass, String classPathString) {
        this.mainClass = mainClass;
        System.out.println(File.pathSeparator);
        bootstrapClassLoader = new BootstrapClassLoader(
                Arrays.asList(classPathString.split(File.pathSeparator))
        );
    }

    public void start() throws ClassNotFoundException {
        // 启动JVM
        System.out.println("启动JVM");
        // 加载类
        System.out.println("加载类");
        // 执行main方法
        System.out.println("执行main方法");
        ClassFile classFile = bootstrapClassLoader.loadClass(mainClass);

    }


}
